package com.naizhuai.ui.task.deliverentity;

import java.io.Serializable;

/**
 * @author：lichenxi
 * @date 2018/3/26 17
 * email：525603977@qq.com
 * Fighting
 */
public class TaskType implements Cloneable, Serializable {
    private String typename;
    private String value;
    //default 1
    private String enable;

    public String getEnable() {
        return enable;
    }

    public void setEnable(String enable) {
        this.enable = enable;
    }


    public String getValue() {
        return value;
    }

    public TaskType(String typename, String value) {
        this(typename, value, "1");
    }

    public TaskType(String typename, String value, String enable) {
        this.typename = typename;
        this.value = value;
        this.enable = enable;
    }

    public TaskType(String typename) {
        this.typename = typename;
    }


    public String getTypename() {
        return typename;
    }

    private boolean selected = false;


    public boolean setSelected(boolean selected) {
        if (this.selected == selected)
            return false;
        this.selected = selected;
        return true;
    }

    public boolean isSelected() {
        return selected;
    }

    public boolean toggleSelected() {
        selected = !selected;
        return selected;
    }

    @Override
    public TaskType clone() {
        TaskType clone = null;
        try {
            clone = (TaskType) super.clone();

        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);  // won't happen
        }

        return clone;
    }
}
